import {
  saveDataByKey
} from '@/utils/util'

export default {
  setUserInfo(state, data) {
    state.userInfo = data
    state.userOrgIds = data.isMuilUnitUser ? data.organizationIds : data.org.id
  },
  setQiniuPath(state, data) {
    state.qiniuPath = data
  },
  setPlatformCode(state, data) {
    state.platformCode = data
  },
  setIsOffline(state, data) {
    state.isOffline = data
  },
  setAppKeyObj(state, data) {
    state.appKeyObj = data
  },
  setUnitRecords(state, data) {
    state.unitRecords = data
    saveDataByKey('unit_search_records', JSON.stringify(data))
  },
  isRenovateChange(state, data) {
    state.isRenovate = data
  },
  isShowInspectionChange(state, data) {
    state.isShowInspection = data
  },
  setCurInspectTaskId(state, data) {
    state.curInspectTaskId = data
  },
  setCarrerTouScroll(state, value) {
    state.carrerTouScroll = value
  },
}
